/**
 * @description: user role参数校验
 * @version: 0.0.1
 * @author: ljr
 * @Date: 2023-06-08 14:07:35
 */

import { Rule, RuleType } from '@midwayjs/validate';

export const requiredString = RuleType.string().required();
export const requiredNumber = RuleType.number().required();
export const requiredObject = RuleType.object().required();
export const requiredAny = RuleType.any().required();

export class UpdateDTO {
  @Rule(requiredNumber)
  id: number;
  @Rule(requiredString)
  roleName: string;
  @Rule(requiredString)
  roleCode: string;
}

export class CreatedDTO {
  @Rule(requiredString)
  roleName: string;
  @Rule(requiredString)
  roleCode: string;
}